home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / include / wcealt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  10.8 KB  |  247 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef __WCEALT_H__ 
  12. #define __WCEALT_H__
  13.  
  14. #if !defined(_WIN32_WCE_NO_WININET)
  15. #include <wininet.h>
  16. #endif
  17.  
  18. // The WinCE OS headers #defines the following, 
  19. // but it interferes with MFC member functions.
  20. #undef TrackPopupMenu
  21. #undef DrawIcon
  22. #undef SendDlgItemMessage
  23. #undef SetDlgItemText
  24. #undef GetDlgItemText
  25. #undef LoadCursor
  26.  
  27. // ATLCONV.H support
  28. #ifndef _ASSERTE
  29. #define _ASSERTE ASSERT
  30. #endif
  31.  
  32. #define wce_T2CA(lpszSrc) \
  33.     (lpszSrc ? wce_T2CAHelper((LPSTR)_alloca((_tcslen(lpszSrc)+1)*2), lpszSrc) : NULL)
  34.  
  35. #if defined(_WIN32_WCE_PSPC)
  36. #ifndef _DEBUG
  37. #define USES_CONVERSION int _convert; _convert
  38. #else
  39. #define USES_CONVERSION int _convert = 0;
  40. #endif
  41. #define A2CT(lpa) (\
  42.     ((LPCSTR)lpa == NULL) ? NULL : (\
  43.         _convert = (lstrlenA(lpa)+1),\
  44.         (LPCWSTR)AfxA2WHelper((LPWSTR) alloca(_convert*2), lpa, _convert)\
  45.     )\
  46. )
  47.  
  48. #ifndef OFN_READONLY
  49. #define OFN_READONLY 0
  50. #endif
  51. #endif // _WIN32_WCE_PSPC 
  52.  
  53. typedef struct tagHELPINFO     
  54. {
  55. }  HELPINFO;
  56. typedef void* LPHELPINFO;
  57.  
  58. // WinCE: CESYSGEN prunes the following FRP defines, 
  59. // and INTERNET_TRANSFER_TYPE_ASCII breaks in wininet.h
  60. #undef FTP_TRANSFER_TYPE_ASCII
  61. #define FTP_TRANSFER_TYPE_ASCII 0x00000001
  62. #undef FTP_TRANSFER_TYPE_BINARY
  63. #define FTP_TRANSFER_TYPE_BINARY 0x00000002
  64.  
  65. #define MM_TEXT 1
  66. typedef DWORD OLE_COLOR;
  67. #define WS_OVERLAPPEDWINDOW 0 
  68.  
  69. #ifndef MF_BITMAP
  70. #define MF_BITMAP 0x00000004L
  71. #endif
  72.  
  73. #ifndef WS_EX_CAPTIONOKBTN
  74. #define WS_EX_CAPTIONOKBTN 0x80000000L
  75. #endif
  76.  
  77. #ifndef WS_EX_NODRAG
  78. #define WS_EX_NODRAG       0x40000000L
  79. #endif
  80.  
  81. // Forward declarations
  82. class  CWnd;
  83. class  CFrameWnd;
  84. struct CCreateContext;
  85. class  CPropertySheet;
  86.  
  87. // WCEALT.CPP
  88. BOOL      wce_SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
  89. FARPROC   wce_GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
  90. HMODULE   wce_LoadLibraryA(LPCSTR lpLibFileName);
  91. BOOL      wce_WinHelp(HWND hWndMain, LPCTSTR lpszHelp, UINT uCommand, DWORD dwData); 
  92. wchar_t*  wce_AsciiToWide(wchar_t* ws, const char* s);
  93. wchar_t*  wce_AsciiToWide(const char* s);
  94. PSTR      wce_T2CAHelper(LPSTR lpszDest, LPCTSTR lpszSrc);
  95. BOOL      wce_CheckEmulationLibs(HINSTANCE hInstance);
  96. int       wce_GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount);
  97. void      wce_WaitMessage();
  98. int       wce_wsprintfA(LPSTR szBuf, LPCSTR szFormat, UINT nArg);
  99. BOOL      wce_IsBadStringPtrA(LPCSTR lpsz, UINT ucchMax);
  100. BOOL      wce_IsBadStringPtrW(LPCWSTR lpsz, UINT ucchMax);
  101. void      wce_ReportDebugBreak(TCHAR *szFile, int nLine);
  102. HPEN      wce_CreatePen(int nPenStyle, int nWidth, COLORREF crColor);
  103. HBRUSH    wce_CreateBrushIndirect(const LOGBRUSH* lplb);
  104. HFONT     wce_CreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, LPCTSTR lpszFacename);
  105. HRGN      wce_CreateRectRgn(int x1, int y1, int x2, int y2);
  106. BOOL      wce_SetRectRgn(HRGN hrgn, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
  107. BOOL      wce_GetBrushOrgEx(HDC hdc, LPPOINT lppt);
  108. int       wce_OffsetClipRgn(HDC hdc, int nXOffset, int nYOffset);
  109. int       wce_ExtSelectClipRgn(HDC hdc, HRGN hrgn, int fnMode);
  110. int       wce_ExcludeUpdateRgn(HDC hDC, HWND hWnd);
  111. BOOL      wce_PolyPolyline(HDC hdc, const POINT* lppt, const DWORD* lpdwPolyPoints, DWORD cCount);
  112. BOOL      wce_PolyPolygon(HDC hdc, const POINT* lpPoints, const int* lpPolyCounts, int nCount);
  113. int       wce_FrameRect(HDC hdc, const RECT* lprc, HBRUSH hbr);
  114. UINT      wce_GetSystemDirectory(LPWSTR lpBuffer, UINT uSize);
  115. UINT      wce_GetSystemDirectoryA(LPSTR lpBuffer, UINT uSize);
  116. TCHAR*    wce_GetNextArg(TCHAR* pszArgList, TCHAR szArg[]);
  117. int       wce_GetArgCount(TCHAR* pszArgList);
  118. BOOL      wce_ArgvW(int argc, char* argv[]);
  119. DWORD     wce_GetObjectStoreFreeSpace();
  120. UINT      wce_GetTempFileName(LPCTSTR lpPathName, LPCTSTR lpPrefixString, UINT uUnique, LPTSTR lpTempFileName);
  121. DWORD     wce_GetFullPathName(LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR *lpFilePart);
  122. short     wce_GetFileTitleW(LPCTSTR lpszFile, LPTSTR lpszTitle, WORD cbBuf);
  123. HMENU     wce_GetMenu(HWND hWnd);
  124. BOOL      wce_SetMenu(HWND hWnd, HMENU hMenu);
  125. UINT      wce_GetMenuItemID(HMENU hMenu, int nPos);
  126. BOOL      wce_ModifyMenu(HMENU hMnu, UINT uPosition, UINT uFlags, UINT uIDNewItem, LPCTSTR lpNewItem);
  127. int       wce_GetMenuItemCount(HMENU hMenu);
  128. int       wce_GetMenuString(HMENU hMenu, UINT uIDItem, LPWSTR lpString, int nMaxCount, UINT uFlag);
  129. UINT      wce_GetMenuState(HMENU hMenu, UINT uId, UINT uFlags);
  130. BOOL      wce_InvalidateRgn(HWND hWnd, HRGN hRgn, BOOL bErase);
  131. BOOL      wce_PreCreateWindow(CREATESTRUCT& cs);
  132. void      wce_PostCreateWindow(CREATESTRUCT& cs, HWND hWnd, HMENU nIDorHMenu);
  133. int       wce_GetScrollPos(HWND hWnd, int nBar);
  134. BOOL      wce_GetScrollRange(HWND hWnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos);
  135. void      wce_ScrollChildren(HWND hWnd, int cx, int cy);
  136. BOOL      wce_ShowScrollBar(HWND hWnd, int nBar, BOOL bShow);
  137. BOOL      wce_EnumChildWindows(HWND hWndParent, WNDENUMPROC lpEnumFunc, LPARAM lParam);
  138. int       wce_GetSystemMetrics(int nIndex);
  139. BOOL      wce_RedrawWindow(HWND hWnd, CONST RECT *prcUpdate, HRGN hrgnUpdate, UINT afuRedraw);
  140. void      wce_AdjustPropertySheetSize(CPropertySheet *pSheet);
  141. BOOL CALLBACK    wce_FirstDlgProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
  142. LRESULT CALLBACK wce_NullWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
  143. LRESULT CALLBACK wce_FirstDefWindowProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
  144. BOOL      wce_WriteProfileStringW(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpString);
  145. DWORD     wce_GetProfileStringW(LPCWSTR lpAppName, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize);
  146. LONG      wce_RegQueryValue(HKEY hKey, LPCWSTR lpSubKey, LPWSTR lpValue, PLONG   lpcbValue);
  147. LONG      wce_RegOpenKey(HKEY hKey, LPCTSTR lpSubKey, PHKEY phkResult);
  148. LONG      wce_RegSetValue(HKEY hKey, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData);
  149. LONG      wce_RegCreateKey(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult);
  150. LONG      wce_RegEnumKey(HKEY hKey, DWORD dwIndex, LPTSTR lpName, DWORD cbName);
  151. LONG      wce_RegQueryValue(HKEY hKey, LPCWSTR lpSubKey, LPWSTR lpValue, PLONG   lpcbValue);
  152. #if !defined(_WIN32_WCE_NO_WININET)
  153. BOOL      wce_InternetSetOptionEx(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD);
  154. #endif // _WIN32_WCE_NO_WININET
  155.  
  156.  
  157. // WCETIME.CPP
  158. #ifndef _TM_DEFINED
  159. #define _TM_DEFINED
  160. struct tm {
  161.         int tm_sec;     /* seconds after the minute - [0,59] */
  162.         int tm_min;     /* minutes after the hour - [0,59] */
  163.         int tm_hour;    /* hours since midnight - [0,23] */
  164.         int tm_mday;    /* day of the month - [1,31] */
  165.         int tm_mon;     /* months since January - [0,11] */
  166.         int tm_year;    /* years since 1900 */
  167.         int tm_wday;    /* days since Sunday - [0,6] */
  168.         int tm_yday;    /* days since January 1 - [0,365] */
  169.         int tm_isdst;   /* daylight savings time flag */
  170.         };
  171. #endif // _TM_DEFINED
  172. long        wce_GetMessageTime();
  173. time_t      wce_mktime(struct tm* );
  174. struct tm * wce_localtime(const time_t *);
  175. char*       wce_ctime(const time_t* );
  176. time_t        wce_time(time_t *);
  177.  
  178. // WCEFRDLG.CPP
  179. #define FR_DOWN                         0x00000001
  180. #define FR_WHOLEWORD                    0x00000002
  181. #define FR_MATCHCASE                    0x00000004
  182. #define FR_FINDNEXT                     0x00000008
  183. #define FR_REPLACE                      0x00000010
  184. #define FR_REPLACEALL                   0x00000020
  185. #define FR_DIALOGTERM                   0x00000040
  186. #define FR_SHOWHELP                     0x00000080
  187. #define FR_ENABLEHOOK                   0x00000100
  188. #define FR_ENABLETEMPLATE               0x00000200
  189. #define FR_NOUPDOWN                     0x00000400
  190. #define FR_NOMATCHCASE                  0x00000800
  191. #define FR_NOWHOLEWORD                  0x00001000
  192. #define FR_ENABLETEMPLATEHANDLE         0x00002000
  193. #define FR_HIDEUPDOWN                   0x00004000
  194. #define FR_HIDEMATCHCASE                0x00008000
  195. #define FR_HIDEWHOLEWORD                0x00010000
  196. typedef UINT (APIENTRY *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  197. typedef struct tagFINDREPLACEW 
  198. {
  199.    DWORD        lStructSize;        // size of this struct 0x20
  200.    HWND         hwndOwner;          // handle to owner's window
  201.    HINSTANCE    hInstance;          // instance handle of.EXE that
  202.                                     //   contains cust. dlg. template
  203.    DWORD        Flags;              // one or more of the FR_??
  204.    LPWSTR       lpstrFindWhat;      // ptr. to search string
  205.    LPWSTR       lpstrReplaceWith;   // ptr. to replace string
  206.    WORD         wFindWhatLen;       // size of find buffer
  207.    WORD         wReplaceWithLen;    // size of replace buffer
  208.    LPARAM       lCustData;          // data passed to hook fn.
  209.    LPFRHOOKPROC lpfnHook;           // ptr. to hook fn. or NULL
  210.    LPCWSTR      lpTemplateName;     // custom template name
  211. } FINDREPLACE, *LPFINDREPLACE;
  212. HWND wce_FindText(LPFINDREPLACE lpfr);
  213. HWND wce_ReplaceText(LPFINDREPLACE lpfr);
  214.  
  215. // WCEOLE.CPP
  216. void    wce_ReleaseStgMedium(LPSTGMEDIUM lpstgMedium);
  217. void    wce_OleUninitialize();
  218. SCODE   wce_OleInitialize(LPVOID pvReserved);
  219. HRESULT wce_CoDisconnectObject(IUnknown*, unsigned long);
  220. HRESULT wce_CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM* ppstm);
  221. HRESULT wce_OleLoadFromStream (LPSTREAM pStm, REFIID iidInterface, LPVOID FAR* ppvObj);
  222. HRESULT wce_OleSaveToStream(LPPERSISTSTREAM pPStm, LPSTREAM pStm);
  223. HRESULT wce_CLSIDFromProgID(LPCOLESTR, LPCLSID);
  224. void    wce_UnregisterOleWindowClasses();
  225. LPVOID  wce_CoTaskMemRealloc(LPVOID pv, ULONG cbOld, ULONG cb);
  226. HRESULT wce_OleTranslateColor(OLE_COLOR clr, HPALETTE hpal, COLORREF* lpcolorref);
  227. HRESULT wce_OleCreateFontIndirect(void* lpFontDesc, REFIID riid, LPVOID* lplpvObj);
  228. UINT WINAPI CoTaskMemSize(LPVOID);
  229. LRESULT CALLBACK wce_IMMWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
  230.  
  231.  
  232. // WinCE: Obsolete workaround from MFCCE 2.0
  233. void inline ATLConnectSinks(CWnd *pCtrl) 
  234.  
  235. // There is no new.h for WinCE, so we define a placement new here.
  236. inline void * operator new(size_t, void * ptr) 
  237.     return ptr; 
  238. }
  239.  
  240. #include <wcealt.inl>
  241.  
  242. #endif // __WCEALT_H__
  243.  
  244.